<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>Docs For Class Rho_Cache</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
						<script src="../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../media/images/plus.png";
				imgMinus.src = "../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Rho_Cache</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Provides static methods for server-side caching.</p>
<p class="description"><p>Example: <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$foo</span>=<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodload">load</a><span class="src-sym">(</span><span class="src-str">'foos'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'foo1'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$foo</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-var">$foo</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$foo</span>=<span class="src-id">createFoo</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodsave">save</a><span class="src-sym">(</span><span class="src-str">'foos'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'foo1'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$foo</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-var">$foo</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">}</span></div></li>
</ol></div></p><p>This class is never instantated.</p></p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../Rho/Rho_Cache.html#methodclear">Rho_Cache::clear()</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_rho---cache.inc.php.html">/rho/cache.inc.php</a> (line <span class="field">29</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
											
				<div class="method-definition">
					<img src="../media/images/StaticMethod.png" alt=" "/>
					static 						<span class="method-result">bool</span>
										<a href="#clear" title="details" class="method-name">clear</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>)
									</div>
															
				<div class="method-definition">
					<img src="../media/images/StaticMethod.png" alt=" "/>
					static 						<span class="method-result">bool</span>
										<a href="#clearAll" title="details" class="method-name">clearAll</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../media/images/StaticMethod.png" alt=" "/>
					static 						<span class="method-result">bool</span>
										<a href="#delete" title="details" class="method-name">delete</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$oid</span>)
									</div>
															
				<div class="method-definition">
					<img src="../media/images/StaticMethod.png" alt=" "/>
					static 						<span class="method-result">bool|mixed</span>
										<a href="#load" title="details" class="method-name">load</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$oid</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$max_age</span> = <span class="var-default">0</span>])
									</div>
															
				<div class="method-definition">
					<img src="../media/images/StaticMethod.png" alt=" "/>
					static 						<span class="method-result">bool</span>
										<a href="#save" title="details" class="method-name">save</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$oid</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">&$item</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$max_age</span> = <span class="var-default">0</span>])
									</div>
																																																							</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodclear" id="clear"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/StaticMethod.png" />
		<span class="method-title">static clear</span> (line <span class="line-number">113</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Clear the cache of a group of items.</p>
<p class="description"><p>Passing a prefix of 'foos' will delete all items  that were previously saved with the prefix 'foos'.</p><p>Intelligent use of $prefix can allow grouping, e.g.  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodsave">save</a><span class="src-sym">(</span><span class="src-str">'foos.widgets'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'widget1'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$widget1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodsave">save</a><span class="src-sym">(</span><span class="src-str">'foos.widgets'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'widget2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$widget2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodsave">save</a><span class="src-sym">(</span><span class="src-str">'foos.bars'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'bar1'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$my_bar</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;...</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">#&nbsp;only&nbsp;delete&nbsp;widgets&nbsp;-&nbsp;bar1&nbsp;will&nbsp;still&nbsp;exist</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodclear">clear</a><span class="src-sym">(</span><span class="src-str">'foos.widgets'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$bar</span>=<span class="src-id"><a href="../Rho/Rho_Cache.html">Rho_Cache</a></span><span class="src-sym">::</span><a href="../Rho/Rho_Cache.html#methodload">load</a><span class="src-sym">(</span><span class="src-str">'foos.bars'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'bar1'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">#&nbsp;This&nbsp;will&nbsp;delete&nbsp;all&nbsp;foos</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-id">Rho_Cahce</span><span class="src-sym">::</span><span class="src-id">clear</span><span class="src-sym">(</span><span class="src-str">'foos'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE on sucess.</li>
				<li><span class="field">see:</span> <a href="../Rho/Rho_Cache.html#methodclearAll">Rho_Cache::clearAll()</a></li>
				<li><span class="field">throws:</span> Rho_Exception if prefix is empty.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		static <span class="method-result">bool</span>
		<span class="method-name">
			clear
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$prefix</span><span class="var-description">: The type of thing being cached, e.g. 'foos'.  Should be ASCII lowercase no symbols except . and _ .</span>			</li>
				</ul>
		
			
	</div>
<a name="methodclearAll" id="clearAll"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/StaticMethod.png" />
		<span class="method-title">static clearAll</span> (line <span class="line-number">125</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Empties the entire cache.</p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE on sucess.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		static <span class="method-result">bool</span>
		<span class="method-name">
			clearAll
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoddelete" id="delete"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/StaticMethod.png" />
		<span class="method-title">static delete</span> (line <span class="line-number">85</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Delete an item from the cache.</p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE is the item was deleted. FALSE is the item didn't exist, or could not be deleted.</li>
				<li><span class="field">see:</span> <a href="../Rho/Rho_Cache.html#methodclear">Rho_Cache::clear()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		static <span class="method-result">bool</span>
		<span class="method-name">
			delete
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$oid</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$prefix</span><span class="var-description">: The type of thing being cached, e.g. 'foos'.</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$oid</span><span class="var-description">: A unique identifier for the thing to be loaded, e.g. '1f3870be274f6c49b3e31a0c6728957f' .</span>			</li>
				</ul>
		
			
	</div>
<a name="methodload" id="load"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/StaticMethod.png" />
		<span class="method-title">static load</span> (line <span class="line-number">68</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Load an item from the cache.</p>
	<ul class="tags">
				<li><span class="field">return:</span> FALSE if the item is not in the cache, otherwise the item that was saved.</li>
				<li><span class="field">see:</span> <a href="../Rho/Rho_Cache.html#methodsave">Rho_Cache::save()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		static <span class="method-result">bool|mixed</span>
		<span class="method-name">
			load
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$oid</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$max_age</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$prefix</span><span class="var-description">: The type of thing being cached, e.g. 'foos'. Should be ASCII lowercase no symbols except . and _ .</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$oid</span><span class="var-description">: A unique identifier for the thing to be loaded, e.g. '1f3870be274f6c49b3e31a0c6728957f' . Should be ASCII lowercase no symbols except . and _ .</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$max_age</span><span class="var-description">: Maximum age in seconds of the item to fetch from the cache.  If 0, then the default time is used.  You should use the same value of $max_age both for saving and loading items with the same prefix.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsave" id="save"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/StaticMethod.png" />
		<span class="method-title">static save</span> (line <span class="line-number">51</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Save something to the cache.</p>
<p class="description"><p>Generally you should call Rho_Cache::load() first and check for a non-false result before calling save.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE on sucess.</li>
				<li><span class="field">see:</span> <a href="../Rho/Rho_Cache.html#methodload">Rho_Cache::load()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		static <span class="method-result">bool</span>
		<span class="method-name">
			save
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$prefix</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$oid</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">&$item</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$max_age</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$prefix</span><span class="var-description">: The type of thing being cached, e.g. 'foos'. Should be ASCII lowercase no symbols except . and _ .</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$oid</span><span class="var-description">: A unique identifier for the thing to be saved, e.g. '1f3870be274f6c49b3e31a0c6728957f' . Should be ASCII lowercase no symbols except . and _ .</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">&$item</span><span class="var-description">: The thing to save to the cache.</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$max_age</span><span class="var-description">: Maximum age in seconds of the item to save the cache.  If 0, then the default time is used.  You should use the same value of $max_age both for saving and loading items with the same prefix.</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Tue, 13 Oct 2009 19:17:18 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>